package ru.tulupov.factorialcalculator;

import java.math.BigInteger;

/**
 * Factorial
 * 
 * @author <a href="mailto:zhekka3@gmail.com">Eugene Tulupov</a>
 */
public class Factorial {
	private BigInteger value;

	public Factorial(int n) {
		if (n < 0) {
			throw new InvalidParameterException();
		}

		value = BigInteger.ONE;

		for (int i = 2; i <= n; i++) {
			value = value.multiply(new BigInteger(String.valueOf(i)));
		}
	}

	public BigInteger getValue() {
		return value;
	}
}
